/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function goToAnchor(nameAnchor){
    window.location.hash=nameAnchor;
}
function showSearchSellingHouse() {
    jQuery('#search_side_rentalbasis').hide("slow");
    jQuery('#search_side_payingguest').hide("slow");
    jQuery('#search_side_sellinghouse').show("slow");
}
function showSearchRentalBasis() {
    jQuery('#search_side_payingguest').hide("slow");
    jQuery('#search_side_sellinghouse').hide("slow");
    jQuery('#search_side_rentalbasis').show("slow");
}
function showSearchPayingGuest() {
    jQuery('#search_side_sellinghouse').hide("slow");
    jQuery('#search_side_rentalbasis').hide("slow");
    jQuery('#search_side_payingguest').show("slow");
}
function setSearchListing(newValue) {
    var radioObj = document.frmSSFather.searchListing;
    if(!radioObj)
        return;
    var radioLength = radioObj.length;
    if(radioLength == undefined) {
        radioObj.checked = (radioObj.value == newValue.toString());
        return;
    }
    for(var i = 0; i < radioLength; i++) {
        radioObj[i].checked = false;
        if(radioObj[i].value == newValue.toString()) {
            radioObj[i].checked = true;
        }
    }
}
function setAdvertiseListing(newValue) {
    var radioObj = document.frmSideAdvertise.advertiseListing;
    if(!radioObj)
        return;
    var radioLength = radioObj.length;
    if(radioLength == undefined) {
        radioObj.checked = (radioObj.value == newValue.toString());
        return;
    }
    for(var i = 0; i < radioLength; i++) {
        radioObj[i].checked = false;
        if(radioObj[i].value == newValue.toString()) {
            radioObj[i].checked = true;
        }
    }
}
function startComposing() {
    var rad_val;
    for (i=0; i < document.frmSideAdvertise.advertiseListing.length; i++)
        if (document.frmSideAdvertise.advertiseListing[i].checked)
            rad_val = document.frmSideAdvertise.advertiseListing[i].value;  
    var murl;
    switch (rad_val) {
        case "cSellingHouse":
            murl="advertiseSellingHouse.jsf"
            break
        case "cRentalBasis":
            murl="advertiseRentalBasis.jsf"
            break
        case "cPayingGuest":
            murl="advertisePayingGuest.jsf"
            break
        default:
            murl="";
    }
    if (murl!="") location.href = murl;
}
function pagi() {
    cufonReplace();
}